package com.example.service;

import com.example.entity.Admin;
import com.example.entity.PushMessage;
import com.example.entity.UploadFile;
import com.example.entity.User;
import com.example.mapper.AdminMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

/**
 * @author 叶凯乐
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Resource
    AdminMapper adminMapper;


    @Override
    public boolean login(String adminId, String password) {
        return adminMapper.selectAdminUsernameByAdminUserIdPassword(adminId,password)==null;
       
    }
    @Override
    public ArrayList<User>allAdminChargeUserMessage(String adminId){
       return adminMapper.selectByAdminUserId(adminId);
    }

    @Override
    public boolean register(Admin admin) {
        return adminMapper.insAdminUserIdPasswordUserNameClassNameCollegeName(admin);
    }

    @Override
    public ArrayList<UploadFile> queryByAdminId(String adminId) {
        return adminMapper.selectByAdminChargeUserId(adminId);
    }

    @Override
    public ArrayList<PushMessage> showContent(String adminId) {
        return adminMapper.selectContentByadminId(adminId);
    }

}
